home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-02 | 5.9 KB | 174 lines | [TEXT/MPS ] |
- ;////////////////////////////////////////////////////////////////////////////////
- ;// OPEN SCRIPTING ARCHITECTURE: AppleScript Specific Interface
- ;////////////////////////////////////////////////////////////////////////////////
- ;// Copyright © 1992, 1993 Apple Computer, Inc. All rights reserved.
- ;// Authors: William Cook, Donn Denman, and Warren Harris
- ;////////////////////////////////////////////////////////////////////////////////
-
- IF &TYPE('__INCLUDINGAPPLESCRIPT__') = 'UNDEFINED' THEN
- __INCLUDINGAPPLESCRIPT__ SET 1
-
- IF &TYPE('__INCLUDINGOSA__') = 'UNDEFINED' THEN
- INCLUDE 'OSA.a'
- ENDIF
-
- IF &TYPE('__INCLUDINGTEXTEDIT__') = 'UNDEFINED' THEN
- ;INCLUDE 'TextEdit.a'
- ENDIF
-
- ;////////////////////////////////////////////////////////////////////////////////
- ;// Types and Constants
- ;////////////////////////////////////////////////////////////////////////////////
-
- typeAppleScript EQU 'ascr'
-
- kAppleScriptSubtype EQU typeAppleScript
-
- ; The specific type for the AppleScript instance of the
- ; Open Scripting Architecture type.
-
- typeASStorage EQU typeAppleScript
-
- ;////////////////////////////////////////////////////////////////////////////////
- ;// Script Error Codes
- ;////////////////////////////////////////////////////////////////////////////////
-
- ; Runtime errors:
- errASCantConsiderAndIgnore EQU -2720
- errASCantCompareMoreThan32k EQU -2721
-
- ; Parser/Compiler errors:
- errASTerminologyNestingTooDeep EQU -2760
- errASIllegalFormalParameter EQU -2761
- errASParameterNotForEvent EQU -2762
- errASNoResultReturned EQU -2763
-
- ; Dialect specific script errors:
- ; The range -2780 thru -2799 is reserved for dialect specific error codes.
- ; (Error codes from different dialects may overlap.)
-
- ; English errors:
- errASInconsistentNames EQU -2780
-
- ;////////////////////////////////////////////////////////////////////////////////
- ;// Component Selectors
- ;////////////////////////////////////////////////////////////////////////////////
-
- kASSelectInit EQU $1001
- kASSelectSetSourceStyles EQU $1002
- kASSelectGetSourceStyles EQU $1003
- kASSelectGetSourceStyleNames EQU $1004
-
- ;////////////////////////////////////////////////////////////////////////////////
- ;// OSAGetScriptInfo Selectors
- ;////////////////////////////////////////////////////////////////////////////////
-
- kASHasOpenHandler EQU 'hsod'
- ; This selector is used to query a context as to whether it contains
- ; a handler for the kAEOpenDocuments event. This allows "applets" to be
- ; distinguished from "droplets." OSAGetScriptInfo returns false if
- ; there is no kAEOpenDocuments handler, and returns the error value
- ; errOSAInvalidAccess if the input is not a context.
-
- ;////////////////////////////////////////////////////////////////////////////////
- ;// Initialization
- ;////////////////////////////////////////////////////////////////////////////////
-
- ;pascal OSAError
- ;ASInit(ComponentInstance scriptingComponent,
- ; long modeFlags,
- ; long minStackSize,
- ; long preferredStackSize,
- ; long maxStackSize,
- ; long minHeapSize,
- ; long preferredHeapSize,
- ; long maxHeapSize);
- ;
- ; // This call can be used to explicitly initialize AppleScript. If it is
- ; // not called, the a scripting size resource is looked for and used. If
- ; // there is no scripting size resource, then the constants listed below
- ; // are used. If at any stage (the init call, the size resource, the
- ; // defaults) any of these parameters are zero, then parameters from the
- ; // next stage are used. ModeFlags are not currently used.
- ; // Errors: errOSASystemError = initialization failed
-
- MACRO
- _ASInit
- MOVE.L #((28<<16)|kASSelectInit),-(A7)
- MOVEQ #$0,D0
- DC.W $A82A ; TB 002A
- ENDM
-
- ; These values will be used if ASInit is not called explicitly, or if any
- ; of ASInit's parameters are zero:
- kASDefaultMinStackSize EQU ( 4 * 1024)
- kASDefaultPreferredStackSize EQU (16 * 1024)
- kASDefaultMaxStackSize EQU (16 * 1024)
- kASDefaultMinHeapSize EQU ( 4 * 1024)
- kASDefaultPreferredHeapSize EQU (16 * 1024)
- kASDefaultMaxHeapSize EQU (32 * 1024 * 1024)
-
- ;////////////////////////////////////////////////////////////////////////////////
- ;// Source Styles
- ;////////////////////////////////////////////////////////////////////////////////
-
- ;pascal OSAError
- ;ASSetSourceStyles(ComponentInstance scriptingComponent,
- ; STHandle sourceStyles);
- ; // Errors: errOSASystemError = operation failed
-
- MACRO
- _ASSetSourceStyles
- MOVE.L #((4<<16)|kASSelectSetSourceStyles),-(A7)
- MOVEQ #$0,D0
- DC.W $A82A ; TB 002A
- ENDM
-
-
- ;pascal OSAError
- ;ASGetSourceStyles(ComponentInstance scriptingComponent,
- ; STHandle* resultingSourceStyles) ;
- ; // Errors: errOSASystemError = operation failed
-
- MACRO
- _ASGetSourceStyles
- MOVE.L #((4<<16)|kASSelectGetSourceStyles),-(A7)
- MOVEQ #$0,D0
- DC.W $A82A ; TB 002A
- ENDM
-
- ;pascal OSAError
- ;SGetSourceStyleNames(ComponentInstance scriptingComponent,
- ; long modeFlags,
- ; AEDescList* resultingSourceStyleNamesList);
- ; // This call returns an AEList of styled text descriptors the names of the
- ; // source styles in the current dialect. The order of the names corresponds
- ; // to the order of the source style constants, below. The style of each
- ; // name is the same as the styles returned by ASGetSourceStyles.
- ; //
- ; // Errors: errOSASystemError = operation failed
-
- MACRO
- _ASGetSourceStyleNames
- MOVE.L #((8<<16)|kASSelectGetSourceStyleNames),-(A7)
- MOVEQ #$0,D0
- DC.W $A82A ; TB 002A
- ENDM
-
- ; Elements of STHandle correspond to following categories of tokens, and
- ; accessed through following index constants:
- kASSourceStyleUncompiledText EQU 0
- kASSourceStyleNormalText EQU 1
- kASSourceStyleLanguageKeyword EQU 2
- kASSourceStyleApplicationKeyword EQU 3
- kASSourceStyleComment EQU 4
- kASSourceStyleLiteral EQU 5
- kASSourceStyleUserSymbol EQU 6
- kASSourceStyleObjectSpecifier EQU 7
- kASNumberOfSourceStyles EQU 8
-
- ;//////////////////////////////////////////////////////////////////////////////////////////////////////
- ;// You're still here? Go home.
- ENDIF
- ;//////////////////////////////////////////////////////////////////////////////////////////////////////
-